
operators = ["+","-","*","/"]
function = ["print"]

def lex(line):

  part = []; a = []

  part = line.strip().split(" ")

  if len(part)> 1:
      for i in range(0,len(part)):

          if check_alpha(part[i][0])== True and part[i] not in function: ## checking for variables 
              a.append(("variable",part[i]))

          if check_number(part[i][0])== True: ## checking for numbers 
              a.append(("number",part[i]))

          if part[i]== "=": ## for assignment
              a.append(("=",part[i]))

          if part[i] in operators and len(part[i])== 1: ## checking for operators
              a.append(("operator",part[i]))

          if part[i][0]== '"': ## checking for string 
              a.append(("string",part[i]))

          if part[i] in function: ## checking for functions 
              a.append(("function",part[i]))
  print a  # prints the lexer output
                   
def check_alpha(alpha):
  return_value = 0 
  for i in range (65,90):
      if alpha == chr(i) or alpha == chr(i+32):
          return_value = True
          
  return return_value

def check_number(num):
    return_value = 0
    nums = "0123456789"
    if num in nums :
        return_value = True
        
    return return_value

lex(""" hello = "HelloWorld" """)




